package com.cxb.demotest.constant;

/**
 * 保养类型
 */
public enum StatusEnum {
  YES((byte) 1, "有效"),
  NO((byte) 2, "无效");

  /**
   * 编号
   */
  public final byte code;
  /**
   * 描述
   */
  public final String desc;

  StatusEnum(byte code, String desc) {
    this.code = code;
    this.desc = desc;
  }

  public static StatusEnum get(Byte code) {
    if (code == null) {
      return null;
    }

    for (StatusEnum courseStatusEnum : StatusEnum.values()) {
      if (courseStatusEnum.code == code) {
        return courseStatusEnum;
      }
    }
    return null;
  }
}
